function A () {
  return new Promise((resolve, reject) => {
    resolve(1)
  })
}

function B () {
  return new Promise((resolve, reject) => {
    reject(2)
  })
}

function C () {
  return new Promise((resolve, reject) => {
    reject(3)
  })
}

function D () {
  return new Promise((resolve, reject) => {
    resolve(4)
  })
}

async function total () {
  try {
    const a = await A()
    const b = await B()
    const c = await C()
    const d = await D()

    console.log(a, d) // 1 4 - 只有在注释掉 bc 的情况下，才会打印，要不然会被 catch 捕获到
  } catch (error) {
    console.log(error) // 只捕获第一次出错的地方
  }
}

total()